<?php

/**
 * @author Edison P. Quinones Jr
 * @version  1.0.0
 * @copyright 2008
 */

class JumpsiteController extends Zend_Controller_Action
{
	function init()
	{
		$this->initView();
		$this->view->baseUrl = $this->_request->getBaseUrl();
		$webInfoNamespace  = new Zend_Session_Namespace('webInfo');
		$this->view->webInfo = $webInfoNamespace->webInfo;
		//Zend_Loader::loadClass('HeaderLink');
		$countWords = strlen($_SERVER['REQUEST_URI']);
		if (strpos($_SERVER['REQUEST_URI'], '/', $countWords-1) == true)
		{
			$this->_redirect(substr_replace($_SERVER['REQUEST_URI'], '', $countWords-1));
			//$this->view->testingLang = substr_replace($_SERVER['REQUEST_URI'], '', $countWords-1);
		}
		$this->view->user = Zend_Auth::getInstance()->getIdentity();

		# Links
		$arrayLinksNamespace = new Zend_Session_Namespace('arrayLinks');
		$arrayLinks = $arrayLinksNamespace->arrayLinksConfig;
		$this->view->links = $arrayLinks;
		# end of links
	}
	function indexAction()
	{
		$webInfoNamespace  = new Zend_Session_Namespace('webInfo');
		$webInfo = $webInfoNamespace->webInfo;
		$this->view->headerAdditional = '
			<!-- GC -->
			<!-- LIBS -->
			<script type="text/javascript" src="'.$webInfo.'nextix_2.0.1/adapter/ext/ext-base.js"></script>
			<!-- ENDLIBS -->
			
			<script type="text/javascript" src="'.$webInfo.'nextix_2.0.1/ext-all.js"></script>
			
			<script type="text/javascript" src="'.$webInfo.'jscripts/portal/Portal.js"></script>
			<script type="text/javascript" src="'.$webInfo.'jscripts/portal/PortalColumn.js"></script>
			<script type="text/javascript" src="'.$webInfo.'jscripts/portal/Ext.ux.MaximizeTool.js"></script>
			<script type="text/javascript" src="'.$webInfo.'jscripts/portal/Portlet.js"></script>
			<script type="text/javascript" src="'.$webInfo.'jscripts/portal/sample.js"></script>
			<script type="text/javascript" src="'.$webInfo.'jscripts/portal/sample-grid.js"></script>
			<link rel="stylesheet" type="text/css" href="'.$webInfo.'css/portal/portal.css" />   
			<link rel="stylesheet" type="text/css" href="'.$webInfo.'css/portal/sample.css" />
			<link rel="stylesheet" type="text/css" href="'.$webInfo.'nextix_2.0.1/resources/css/ext-all.css" />';
	}
	function viewAction()
	{
		$webInfoNamespace  = new Zend_Session_Namespace('webInfo');
		$webInfo = $webInfoNamespace->webInfo;
		$this->view->headerAdditional = '
			<!-- GC -->
			<!-- LIBS -->
			<script type="text/javascript" src="'.$webInfo.'nextix_2.0.1/adapter/ext/ext-base.js"></script>
			<!-- ENDLIBS -->
			
			<script type="text/javascript" src="'.$webInfo.'nextix_2.0.1/ext-all.js"></script>
			
			<script type="text/javascript" src="'.$webInfo.'jscripts/portal/Portal.js"></script>
			<script type="text/javascript" src="'.$webInfo.'jscripts/portal/PortalColumn.js"></script>
			<script type="text/javascript" src="'.$webInfo.'jscripts/portal/Ext.ux.MaximizeTool.js"></script>
			<script type="text/javascript" src="'.$webInfo.'jscripts/portal/Portlet.js"></script>
			<script type="text/javascript" src="'.$webInfo.'jscripts/portal/sample.js"></script>
			<script type="text/javascript" src="'.$webInfo.'jscripts/portal/sample-grid.js"></script>
			<link rel="stylesheet" type="text/css" href="'.$webInfo.'css/portal/portal.css" />   
			<link rel="stylesheet" type="text/css" href="'.$webInfo.'css/portal/sample.css" />
			<link rel="stylesheet" type="text/css" href="'.$webInfo.'nextix_2.0.1/resources/css/ext-all.css" />';
	}
}